﻿@{
    ViewBag.Title = "查看任务计划表";
    Layout = "~/Views/Shared/_Main.cshtml";
}
<script src="@Url.Content("~/Scripts/jquery-1.11.0.min.js")" type="text/javascript"></script>
<script src="/Res/easyui/jquery.easyui.min.js" type="text/javascript"></script>
<script src="@Url.Content("~/Res/MyJs.js")" type="text/javascript"></script>
<link href="@Url.Content("~/CSS/style.css")" rel="stylesheet" type="text/css" />
<link href="@Url.Content("~/Res/easyui/themes/icon.css")" rel="stylesheet"
        type="text/css" />
<link href="@Url.Content("~/Res/easyui/themes/default/easyui.css")" rel="stylesheet"
        type="text/css" />
<style type="text/css">
    .panel-tool
    {
        display: none;
    }
    .table_bg td
    {
        white-space: nowrap;
    }
    .trBg
    {
        line-height: 22px;
        background: #efefef;
    }
    .w40
    {
        width: 40px;
    }
    .cw
    {
        width: 33px;
        text-align: center;
        font-weight: bold;
    }
    .c0
    {
        color: #000000;
    }
    .c1
    {
        color: #0000FF;
    }
    .c2
    {
        color: #ff0000;
    }
    .c3
    {
        color: #00FF00;
    }
    .c4
    {
        color: #008000;
    }
</style>
<script src="/Res/easyui/locale/easyui-lang-zh_CN.js" type="text/javascript"></script>
<script type="text/javascript">
    var UrlArray = $.getUrlArray();
    $(function () {
        TaskRunStatus();
    });
    function btnExport_Click() {
        var arrData = new Array();
        arrData.push("ExportType=Excel");
        jv.formNew("/SysJob/ExportData/?dbName=" + encodeURI(UrlArray["dbName"]), arrData);
    }
    function btnClose_Click() {
        window.close(); //关闭子页面 
    }
    function TaskRunStatus() { 
        $.post("/SysJob/GetTableColumns?dbName=" + encodeURI(UrlArray["dbName"]), function (result) {
            if (result && result.length > 0) {
                var columnsArray = new Array();
                for (var i = 0; i < result.length; i++) {
                    columnsArray.push({ field: result[i].ColumnName, title: result[i].ColumnDescription, width: 40, align: "center" });
                }
                columnsArray.push({ title: '', width: 40 });
                var dataGridWidth = (result.length * 40);
                $("#TaskRunStatus").datagrid({
                    height: 390,
                    autoRowWidth: true,
                    fitColumns: true,
                    pagination: false,
                    rownumbers: true,
                    striped: true,
                    singleSelect: true,
                    url: '/SysJob/GetTaskRunStatus/?dbName=' + encodeURI(UrlArray["dbName"]),
                    frozenColumns: [[
	                { title: '任务名称', field: 'TaskName', width: 200 },
	                { title: '任务状态', field: 'TaskStatus', width: 60, align: 'center' },
	                { title: '执行周期', field: 'TaskIntervalDays', width: 60, align: 'center' },
	                { title: '分钟间隔', field: 'TaskEveryDayIntervalMinute', align: 'center', width: 60 }
				    ]],
                    columns: [columnsArray],
                    onLoadSuccess: function (data) { 
                        $(".datagrid-view2 .datagrid-cell").removeAttr("style");
                        $(".datagrid-view2 td").each(function (d) { $(this).find("div").addClass("w40"); });
                    }
                });
            }
        });
    } 
</script>
<div style="margin: 5px; height: 480px; padding-right: 2px;">
    <div id="tab2" style="display: block;">
        <table id="tbLocalTableData1" class="pagTable" cellpadding="0" cellspacing="0" style="background-image: /images/tbdata.jpg;">
        </table>
        <table class="listTitle">
            <tbody>
                <tr>
                    <td width="15">
                        <img src="/images/filesave.png">
                    </td>
                    <td width="150" style="font-size: 12px;">
                        查看任务计划表
                    </td>
                    <td align="right">
                        <input id="btnExport" type="button" value="导出到Excel" class="button" onclick="btnExport_Click()" />
                        <input id="btnClose" type="button" value=" 关 闭 " class="button" onclick="btnClose_Click()" />
                    </td>
                </tr>
            </tbody>
        </table>
        <div id="com" style="line-height: 25px; border-left: solid 1px #ccc; border-right: solid 1px #ccc;
            border-bottom: solid 1px #ccc; margin-right: 0px;">
            <span class='c0'>×：不执行</span>。<span class='c1'>√：N分钟间隔并且状态为启用</span>。 <span class='c2'>
                √：N分钟间隔并且状态为禁用</span>。<span class='c3'>√：N天1次并且状态为启用</span>。 <span class='c4'>√：N天1次并且状态为禁用</span></div>
        <div id="divModelTableData" style="margin-right: 0px; margin-top: 1px;">
            <table id="TaskRunStatus">
            </table> 
        </div>
        <div id="msg">
        </div>
    </div>
</div>
